﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Text;
using System.Windows.Input;

namespace WPFEdit.ViewModels
{
    public class MenuItem : INotifyPropertyChanged
    {
        private String m_name;
        private String m_inputGestureText;
		private bool m_isSeparator = false;

		public bool IsSeparator
		{
			get { return m_isSeparator; }
			set { m_isSeparator = value; }
		}

        public String InputGestureText
        {
            get { return m_inputGestureText; }
            set { m_inputGestureText = value; }
        }

        public String Name
        {
            get { return m_name; }
            set
            {
                if (m_name != value)
                {
                    m_name = value;
                    if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Name"));
                }
            }
        }

        private ObservableCollection<MenuItem> m_subMenu = new ObservableCollection<MenuItem>();

        public ObservableCollection<MenuItem> SubMenu
        {
            get { return m_subMenu; }
            set
            {
                if (m_subMenu != value)
                {
                    m_subMenu = value;
                    if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("SubMenu"));
                }
            }
        }

        private ICommand m_command;

        public ICommand Command
        {
            get { return m_command; }
            set
            {
                m_command = value;
                if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Command"));
            }
        }

        private bool m_enabled = true;

        public bool Enabled
        {
            get { return m_enabled; }
            set
            {
                if (m_enabled != value)
                {
                    m_enabled = value;
                    if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs("Enabled"));
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
